package ExceptionDemo;

public class ExceptionTest {
    /**
     * 手动触发异常
     */

    public static void main(String[] args) {

    }

    private static void test0()
    {

    }

    private static void test1()
    {
        int i=100;
        for (int j=0;j<i;j++)
        {
            if(j%73==0)
            {
                throw new NullPointerException("手动触发异常");
            }
        }
    }

    private static void test2() throws Exception {
        int i=100;
        for (int j=0;j<i;j++)
        {
            if(j%73==0)
            {
                throw new Exception("手动触发异常");
            }
        }
    }
}
